package com.liuche.book.auth.controller;

import com.liuche.book.auth.model.vo.verification.req.SendVerificationCodeReqVO;
import com.liuche.book.auth.service.VerificationCodeService;
import com.liuche.framework.biz.operationlog.aspect.ApiOperationLog;
import com.liuche.framework.common.response.Response;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/verification")
public class VerificationController {
    @Resource
    private VerificationCodeService verificationCodeService;

    @PostMapping("/code/send")
    @ApiOperationLog(description = "发送短信验证码")
    public Response<?> sendCode(@RequestBody @Valid SendVerificationCodeReqVO vo) {
        return verificationCodeService.send(vo);
    }
}
